﻿namespace TDD_Sample
{
    internal class GameNumber
    {
        private int rawNumber;

        public GameNumber(int v)
        {
            this.rawNumber = v;
        }

        public override string ToString()
        {
            if (CanRelate(3) && CanRelate(5))
            {
                return "fizzbuzz";
            }
            if (CanRelate(3))
            {
                return "fizz";
            }

            if (CanRelate(5))
            {
                return "buzz";
            }
            return rawNumber.ToString();
        }
        public bool CanRelate(int i)
        {
            return rawNumber % i == 0 || rawNumber.ToString().Contains(i.ToString());
        }

    }
}